import tkinter as tk
from tkinter import ttk
root = tk.Tk()
root.title('我的网络调试工具')
root.geometry('600x500+100+100')#设置窗口大小
left_frame = tk.Frame(root,bg='red',background='red')
left_frame.pack(side=tk.LEFT,anchor=tk.N,padx=5,pady=5)

net_frame = tk.LabelFrame(left_frame,text="这是一个标签",padx=50,pady=5,bg='blue')
net_frame.pack(anchor=tk.E)

tk.Label(net_frame,text="(1)协议内容",background='red',anchor='w').pack(anchor=tk.W)

scokt_type = ttk.Combobox(net_frame)#布局到
scokt_type['values'] = ['a','b','c']
scokt_type.pack(anchor=tk.W)
scokt_type.current(0)



tk.Label(net_frame,text="(2)协议内容",background='red',anchor='w').pack(anchor=tk.W)

host_addreess = ttk.Combobox(net_frame)#布局到
host_addreess['values'] = ['192.168.2.230','192.168.230.112','221']
host_addreess.pack(anchor=tk.W)
host_addreess.current(0)


tk.Label(net_frame,text="(3)文本手写",background='red',anchor='w').pack(anchor=tk.W)

entryText = ttk.Entry(net_frame)#布局到
entryText.pack(fill=tk.X)

#按钮
button_frame  = tk.Frame(net_frame)
button_frame.pack()

openbutton = tk.Button(button_frame,text='open')

closeButton = tk.Button(button_frame,text='close')
openbutton.pack(side=tk.LEFT)
closeButton.pack(side=tk.RIGHT)

#接受设置 第二区快

recv_frame = tk.LabelFrame(left_frame,text="接受设置",padx=50,pady=5,bg='yellow',fg='black')
recv_frame.pack(side=tk.TOP,anchor=tk.N,fill=tk.X)
tk.Radiobutton(recv_frame,text='UTF-8').pack(anchor=tk.W)
tk.Radiobutton(recv_frame,text='GBK').pack(anchor=tk.W)

tk.Checkbutton(recv_frame,text='JSON').pack(anchor=tk.W)
tk.Checkbutton(recv_frame,text='自动换行').pack(anchor=tk.W)


# 发送设置 第3区快

send_frame = tk.LabelFrame(left_frame,text="接受设置",padx=50,pady=5,bg='pink',fg='black')
send_frame.pack(side=tk.TOP,anchor=tk.N,fill=tk.X)
tk.Radiobutton(send_frame,text='数据加密').pack(anchor=tk.W)
tk.Radiobutton(send_frame,text='信息接受').pack(anchor=tk.W)

tk.Checkbutton(send_frame,text='JSON').pack(anchor=tk.W)
tk.Checkbutton(send_frame,text='自动换行').pack(anchor=tk.W)

#right  右边布局
right_frame = tk.Frame(root,bg='red',background='red')
right_frame.pack(side=tk.RIGHT,anchor=tk.N,padx=5,pady=5)


info_frame = tk.Frame(right_frame)
info_frame.pack()

tk.Label(info_frame,text="数据日志").pack(anchor=tk.W)


text_pad = tk.Text(info_frame,width='62')
text_pad.pack(side=tk.LEFT,fill=tk.X)

send_text_bar = tk.Scrollbar(info_frame)
send_text_bar.pack(side=tk.RIGHT,fill=tk.Y)

tk.Label(right_frame,text="信息发送").pack(anchor=tk.W)

send_frame = tk.Frame(right_frame)
send_frame.pack()

sendArae = tk.Text(send_frame,width=58,height=60)
sendArae.pack(side=tk.LEFT)

send_button = tk.Button(send_frame,text='Send',width=4) 
send_button.pack(side=tk.RIGHT,fill=tk.Y)





root.mainloop() 